/**
 * @file number.hh
 * @author Bono.ASUN.TamGitsun (gitsun.tam@outlook.com)
 * @brief 
 * @version 0.1
 * @date 2022-02-07
 * 
 * @copyright Copyright (c) 2022
 * 
 */


#pragma once


#include "time.hh"
#include <random>


namespace TGS::utils {


template <typename T>
class RandomNumber
{
public:
    RandomNumber(T start, T end):
        mE(static_cast<unsigned int>(get_time_second())), mU(start, end)
    {}
    T next(void)
    {
        return mU(mE);
    }
private:
    std::default_random_engine mE;
    std::uniform_int_distribution<T> mU;
};


template <typename T>
T number_random(T start, T end)
{
    return RandomNumber<T>(start, end).next();
}


}
